package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 批量插入 菜品口味数据
     *
     * @param dishFlavorList
     * @return
     */
    int saveList(@Param("dfList") List<DishFlavor> dishFlavorList);
    /**
     * 删除菜品口味  根据 dish_id
     *
     * @param dishId
     * @return
     */
    @Delete("delete from dish_flavor where dish_id=#{dishId}")
    void delByDishId(Long dishId);
    /**
     * 批量删除口味
     *
     * @param dishIds
     * @return
     */
    void delBatch(List<Long> dishIds);
    /**
     * 根据dishId 查询
     *
     * @param dishId
     * @return
     */
    @Select("select * from dish_flavor where dish_id=#{dishId}")
    List<DishFlavor> getByDishId(Long dishId);
    /**
     * 批量插入
     *
     * @param flavorList
     * @return
     */
    void inserts(List<DishFlavor> flavorList);
}
